package com.maxus.mini.entity.lib;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.apache.commons.lang3.StringUtils;

import com.maxus.mini.common.VersionedAuditableIdEntity;
import com.maxus.mini.entity.user.User;

/**
 * 资源
 * 
 * @author wujinsong
 *
 */
@Entity
@Table(name = "ex_lib")
public class Lib extends VersionedAuditableIdEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 2289942401582743917L;
	
	public Lib() {
	}

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Override
	public Long getId() {
		return id;
	}
	
	/**
	 * 资源类别
	 */
	private int types;
	
	/**
	 * 资源url
	 */
	private String url = StringUtils.EMPTY;
	
	/**
	 * 资源url
	 */
	private String icon = StringUtils.EMPTY;
	
	/**
	 * 资源宽度
	 */
	private int width = 0;
	
	/**
	 * 资源高度
	 */
	private int height =0;
	
	/**
	 * 创建人
	 */
	private User user;
	
	/**
	 * 状态
	 */
	private Integer status;
	
	/**
	 * pid
	 */
	private Integer pid;
	
	/**
	 * 
	 */
	private Date cd;

	public int getTypes() {
		return types;
	}

	public void setTypes(int types) {
		this.types = types;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getIcon() {
		return icon;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}

	public int getWidth() {
		return width;
	}

	public void setWidth(int width) {
		this.width = width;
	}

	public int getHeight() {
		return height;
	}

	public void setHeight(int height) {
		this.height = height;
	}

	@ManyToOne()
	@JoinColumn(name = "uid" )
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public Integer getPid() {
		return pid;
	}

	public void setPid(Integer pid) {
		this.pid = pid;
	}

	public Date getCd() {
		return cd;
	}

	public void setCd(Date cd) {
		this.cd = cd;
	}
}
